package io.yizoo.business.controller;

import io.elm.core.CoreController;
import io.yizoo.business.entity.biz_plm_plan_stage;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.EnumSet;
import java.util.List;

@RestController
@RequestMapping("/business/plm/plan/stage")
public class plm_plan_stageController extends CoreController {

    @Override
    protected void Init() {
        PowerEntity = biz_plm_plan_stage.class;
        PowerUse = EnumSet.of(Power.IDDelete, Power.IDAny, Power.IDGetSingle,Power.IDUpsert);
    }

    @PostMapping("/GetData")
    public Object GetData(@RequestBody String jsonStr) throws Exception {
        List<?> ret = Ctor.CoreMapper.USelect(Ctor.DMaker(jsonStr).Selector
                .Select("*")
                .From(biz_plm_plan_stage.class)
                .IsWhere("and plan_id = #{plan_id}","plan_id")
                .GetFactor());
        return JsonResult(ret);
    }
}
